<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Home</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Motel Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template,
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="applijewelleryion/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<link th:href="@{/css/bootstrap.css}" rel='stylesheet' type='text/css' />
	<link th:href="@{/css/buttons.css}" rel='stylesheet' type='text/css' />
<!-- Custom Theme files -->
<link th:href="@{/css/style.css}" rel='stylesheet' type='text/css' />
<script th:src="@{/js/jquery-1.11.1.min.js}"></script>
<!--webfonts-->
<link href='http://fonts.useso.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.useso.com/css?family=Open+Sans:400,300italic,300,600' rel='stylesheet' type='text/css'>
   <!--//webfonts-->
<script type="text/javascript" >//th:src="@{/js/bootstrap.js}"
var date = new Date();
var month=date .getMonth()+1;
var DAY;
if (date .getDate()<10)
     DAY="0"+date .getDate();
else
    DAY=date.getDate();
var DATE=month+"/"+DAY+"/"+date .getFullYear();

function submits() {
		var text1=document.getElementById("param").value;
	var text2=document.getElementById("datepicker").value;
	var text3=document.getElementById("datepicker1").value;


		if(text1!=""){
			if (text2!="预计入住时间"&&text2!="")//||
				if (text3!="预计离店时间"&&text3!=""){//||
				    if (text2<DATE||text2>=text3)
				        alert("请确认日期是否正确")
                    else {
                        var from1data = $("#SearchText").serialize();
                        var from2data = $("#In").serialize();
                        var from3data = $("#Out").serialize();
                        var data=from1data+'&'+from2data+'&'+from3data;///////
                        $.ajax({
                            //几个参数需要注意一下
                            type: "POST",//方法类型
                            dataType: "json",//预期服务器返回的数据类型
                            url: "/index2" ,//url
                            data: data,
                            success: function (result) {
                                console.log(result);//打印服务端返回的数据(调试用)
                                if (result.resultCode == 200) {
                                    window.location.href="/index2"
                                }
                                ;
                            },
                            error : function() {
                                window.location.href="/select"
                            }
                        });
                    }

				}else {
					alert("请选择预计离店时间");
				}
			else {
				alert("请选择预计入住时间");
			}

		}else
			{ alert("请输入酒店、城市或品牌等关键字"); }

	}

</script>
</head>
<body>
<!-- banner -->
	<div class="banner">

			<div class="header">
				<div class="container">
					<div class="logo">
						<h1><a th:href="@{/}">酒店订购</a></h1>
					</div>
					<nav class="navbar navbar-default" role="navigation">
						<div class="navbar-header">
							<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
								<span class="sr-only">Toggle navigation</span>
								<span class="icon-bar"></span>
								<span class="icon-bar"></span>
								<span class="icon-bar"></span>
							</button>
						</div>
						<!--/.navbar-header-->
						<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
							<ul class="nav navbar-nav">
								<li class="active"><a th:href="@{/}">主页</a></li>
								<!--                            <li><a th:href="@{/offers.html}">相关服务</a></li>-->
								<li th:if="${session.user!=null}"><a th:href="@{/logout}">注销</a></li>
								<li th:if="${session.user==null}"><a th:href="@{/signup}">登录</a></li>
								<li><a th:href="@{/signup}">注册</a></li>
								<li th:if="${session.user!=null}"><a th:href="@{/contact}">订单中心</a></li>
							</ul>
						</div>
						<!--/.navbar-collapse-->

					<div class="clearfix"> </div>

					<!-- search-scripts -->
					<script th:src="@{/js/classie.js}"></script>
					<script th:src="@{/js/uisearch.js}"></script>
					<script>
						new UISearch( document.getElementById( 'sb-search' ) );
					</script>
					<!-- //search-scripts -->

				</div>
			</div>
		</nav>
		<div class="banner-info">
			<div class="container">
				<div class="details-1">
					<div class="col-md-10 dropdown-buttons">
						<div class="col-md-3 dropdown-button">
							<div class="input-group">
								<form th:action="@{/select}" method="post" id="SearchText">
									<input class="form-control has-dark-background" name="param" id="param" th:if="${param1}=='城市、酒店等关键字'" th:placeholder="${param1}" type="text">
									<input class="form-control has-dark-background" name="param" id="param" th:if="${param1}!='城市、酒店等关键字'" th:value="${param1}" type="text">
								</form>


							</div>
						</div>
						<!---strat-date-piker---->
							<link rel="stylesheet" th:href="@{/css/jquery-ui.css}" />
							<script th:src="@{/js/jquery-ui.js}"></script>
							  <script>
									  $(function() {
										$( "#datepicker,#datepicker1" ).datepicker();
									  });
							  </script>
						<!---/End-date-piker---->

						<div class="col-md-3 dropdown-button">
							<div class="book_date">
								<form id="In" th:action="@{/timeIn}" method="post">
									<input class="date" id="datepicker" type="text" th:value="${timeIn}" onFocus="this.value = '';"  onBlur="if (this.value == '') {this.value = '预计入住时间';}" name="in">
								</form>
							</div>
						</div>
					  <div class="col-md-3 dropdown-button">
							<div class="book_date">
								<form id="Out" th:action="@{/timeOut}" method="post">
									<input class="date1" id="datepicker1" type="text" th:value="${timeOut}" onFocus="this.value = '';"  onBlur="if (this.value == '') {this.value = '预计离店时间';}" name="out">
								</form>
							</div>
						</div>
						<div class="col-md-3 dropdown-button">
						  <div class="section_1">
							 <select id="country" onChange="change_country(this.value)" class="frm-field required">
								<option value="null">双人间</option>
								<option value="null">单人间</option>
								<option value="AX">大床房</option>
								<option value="AX">套间</option>
							 </select>
						  </div>
						</div>
						<div class="clearfix"> </div>
					</div>
					<div class="button button-glow button-rounded button-royal">
							<a type="button"  onclick="submits()" style="color: #00cc66">搜索</a>
					</div>
					<div class="clearfix"> </div>
				</div>
			</div>
		</div>
	</div>
	<!-- banner -->
	<!-- hod -->

	<!-- hod -->
    <div class="copyrights">Collect from <a href="http://www.cssmoban.com/" >企业网站模板</a></div>
	<!-- tels -->

    <div class="single">
	<div class="container">
<!--		-->

	</div>
</div>
	<!-- tels -->
	<!-- special -->
	<!-- special -->
	<!-- quick -->
	<!-- quick -->
<!-- footer -->
	<div class="footer">
		<div class="container">
			<div class="col-md-2 deco">
				<h4>导航</h4>
				<li><a th:href="@{/}">主页</a></li>
				<li><a th:href="@{/shortcodes.html}">短信通知</a></li>
				<li><a th:href="@{/sigin.html}">登录</a></li>
				<li><a th:href="@{/contact.html}">相关联系</a></li>
			</div>
			<div class="col-md-2 deco">
				<h4>链接</h4>
				<li><a href="#">关于我们</a></li>
				<li><a href="#">法律支持</a></li>
				<li><a href="#">用户须知</a></li>
			</div>
			<div class="col-md-2 deco">
				<h4>社交软件</h4>
				<div class="soci">
					<li><a href="#"><i class="f-1"> </i></a></li>
					<li><a href="#"><i class="t-1"> </i></a></li>
					<li><a href="#"><i class="g-1"> </i></a></li>
				</div>
			</div>
			<div class="col-md-3 cardss">
				<h4>安全支付</h4>
				<li><i class="WeChatPay"></i></li>
				<li><i class="Alipay"></i></li>
				<li><i class="UnionPay"></i></li>
				<div class="clearfix"> </div>
			</div>
			<div class="col-md-3 pos">
			<h4>实时通知</h4>
					   <form method="post">
						 <input type="text" class="textbox" value="E-mail" onFocus="this.value = '';" onBlur="if (this.value == '') {this.value = 'Email';}">
						 <div class="smt">
							<input type="submit" value="订阅">
						 </div>
					   </form>
			</div>
			<div class="clearfix"> </div>
		</div>
	</div>
	<div class="footer-bottom">
			<div class="container">
				<p>Copyright &copy; 2015.Company name All rights reserved.More Templates <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a>
</p>
			</div>
		</div>
	<!-- footer -->

</body>
</html>